package hc.j2me.item;

import hc.j2me.util.Jcip;
import hc.j2me.util.OutPortTranser;

public class TextField extends javax.microedition.lcdui.TextField implements IPort{

	public TextField() {
		super(Jcip.getInstance().getString(), Jcip.getInstance().getString(), 
				Jcip.getInstance().getInt(), Jcip.getInstance().getInt());
		Jcip.getInstance().init(this);
	}

	public void appendOutPort(OutPortTranser out) {
//		out:{getString()}
		out.out(getString());
	}

	public void appendInPort(Jcip jcip) {
//	in:{setConstraints(int constraints), 
//		setInitialInputMode(String characterSubset), 
//		setString(String text)}
		
		setConstraints(jcip.getInt());
		setInitialInputMode(jcip.getString());
		setString(jcip.getString());
	}

	String id = null;
	public String getID() {
		return id;
	}

	public void setID(String id) {
		this.id = id;
	}
	
	short ioMode = 0;

	public void setIOMode(short mode) {
		this.ioMode = mode;
	}
	
	public short getIOMode(){
		return ioMode;
	}
}
